<?php
class gUsergroup {
	public static function create($gname) {
		galaxy::halt('TODO');
	}
	public static function destroy($gname) {
		galaxy::halt('TODO');
	}
	public static function addMember($gname, $uid, $state=1) {
		galaxy::halt('TODO');
	}
	public static function removeMember($gname, $uid, $state='') {
		galaxy::halt('TODO');
	}
	public static function find($gname, $uid) {
		$arr = self::$M->where("gname='$gname' AND uid='$uid'")->find();
		return intval($arr['state']);
	}
	public static function findGroups($uid) {
		$arr = self::$M->where("uid='$uid' AND state>0")->select();
		$groups = array();
		foreach($arr as $v) {
			$groups[] =$v['gname'];
		}
		return $groups;
	}
	private static $M;
	public static function init() {self::$M = D('usergroup');}
}
gUsergroup::init();

?>